(function (_super) {
    var EVENT_CLICK = Laya.Event.CLICK;

    function ExitScene() {
        ExitScene.super(this);

        this.title = null;
        this.tipsMask = null;
        this.tips = null;
        this.btnContinue = null;
        this.btnExit = null;

        this.init();
    }
    Laya.class(ExitScene, "Alert.Exit", _super);
    var _proto = ExitScene.prototype;
    _proto.destroy = function () {
        _super.prototype.destroy.call(this, true);

        this.title = null;
        this.tipsMask = null;
        this.tips = null;
        this.btnContinue = null;
        this.btnExit = null;
    }

    _proto.create = function () {
        var title = new Laya.Image("res/game/ui/exit_title.png");
            title.centerX = 0;

        var tipsMask = new Laya.Image("res/game/ui/exit_tips_bg.png");
            tipsMask.centerX = 0;
            tipsMask.y = 75;

        var tips = new Laya.Label("(退出游戏还是会扣除次数，并且无法获得对应的奖励)");
            tips.fontSize = 18;
            tips.color = "#ffffff";
            tips.centerX = 0;
            tips.centerY = 0;
        tipsMask.addChild(tips);

        var btnContinue = new Laya.Button("res/game/ui/btn_continue.png");
            btnContinue.stateNum = 1;
            btnContinue.centerX = 0;
            btnContinue.y = 136;
            btnContinue.on(EVENT_CLICK, this, this.destroy);
        
        var btnExit = new Laya.Button("res/game/ui/btn_back_to_hall.png");
            btnExit.stateNum = 1;
            btnExit.centerX = 0;
            btnExit.y = 272;
            btnExit.on(EVENT_CLICK, this, function () {
                ppt.io.emit({"cmd" : "game::pveexit"});
            });

        this.title = title;
        this.tipsMask = tipsMask;
        this.tips = tips;
        this.btnContinue = btnContinue;
        this.btnExit = btnExit;

        this.addChildren(title, tipsMask, btnContinue, btnExit);
    }
    _proto.init = function () {
        this.size(600, 434);

        this.create();
    }
})(Laya.Sprite);